<template>
    <el-row class="tac">
        <el-col :span="24">
            <h5>Menu</h5>
            <el-menu
                router
                :default-active="$route.path"
                class="el-menu-vertical-demo"
                @open="handleOpen"
                @close="handleClose">
                <el-submenu index="1">
                    <template slot="title">
                        <i class="el-icon-location"></i>
                        <span>计划任务</span>
                    </template>

                    <el-menu-item-group>
                        <template slot="title">计划</template>
                        <el-menu-item index="/index/task/list">任务列表</el-menu-item>
                        <el-menu-item index="/index/task/create">创建任务</el-menu-item>
                    </el-menu-item-group>

                </el-submenu>
                <el-menu-item index="2">
                    <i class="el-icon-menu"></i>
                    <span slot="title">导航二</span>
                </el-menu-item>
                <el-menu-item index="3" disabled>
                    <i class="el-icon-document"></i>
                    <span slot="title">导航三</span>
                </el-menu-item>
                <el-menu-item index="4">
                    <i class="el-icon-setting"></i>
                    <span slot="title">导航四</span>
                </el-menu-item>
            </el-menu>
        </el-col>

    </el-row>
</template>

<script>
    export default {
        name: 'Nav',
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath)
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath)
            }
        }
    }
</script>
